import $ from 'jquery';

class Interface {
    /**
     * 获取遗漏数据
     * @param {*} issure 当前旗号
     */
    getOmit(issure) {
        let self = this;
        return new Promise((resolve, reject) => {
            $.ajax({
                url: '/get/omit',
                data: {
                    issure: issure
                },
                dataType: 'json',
                success(res) {
                    self.setOmit(res.data);
                    resolve.call(self, res);
                },
                error(err) {
                    reject.call(self, err);
                }
            })
        })
    }
    // 获取开奖号码
    getOpenCode(issure) {
        let self = this;
        return new Promise((resolve, reject) => {
            $.ajax({
                url: '/get/opencode',
                data: {
                    issure: issure
                },
                dataType: 'json',
                success(res) {
                    self.setOpenCode(res.data);
                    resolve.call(self, res);
                },
                error(err) {
                    reject.call(self, err);
                }
            })
        })
    }
    // 获取状态
    getState(issure) {
        let self = this;
        return new Promise((resolve, reject) => {
            $.ajax({
                url: '/get/state',
                data: {
                    issure: issure
                },
                dataType: 'json',
                success(res) {
                    resolve.call(self, res);
                },
                error(err) {
                    reject.call(self, err);
                }
            })
        })
    }
}
export default Interface;